% TEMPLATE FOR STANDARD QUIZ
% by laura
\documentclass[14pt,epsfig]{article}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{hyperref}
\oddsidemargin=0in
\evensidemargin=0in
\textwidth=6.3in
\topmargin=-0.5in
\textheight=9in

\parindent=0in
\pagestyle{empty}

%testpoints.tex
\oddsidemargin=0in
\evensidemargin=0in
\textwidth=6.3in
\topmargin=-0.5in
\textheight=9in
\parindent=0in
\pagestyle{empty}

\newcounter{problemnum}
\renewcommand{\theproblemnum}{\arabic{problemnum}}
\newcounter{partnum}[problemnum]
\renewcommand{\thepartnum}{\alph{partnum}}
\newcounter{totalpoints}
\newcounter{curprobpts}	
\newcounter{totalparts}
\newcounter{pagepoints}
\newenvironment{problem}[1]{
\refstepcounter{problemnum}
\vspace{0.15in} \par
\setcounter{curprobpts}{#1} \setcounter{totalparts}{0}
{\Large \bf \theproblemnum. \normalsize ({\it \arabic{curprobpts} point\null\ifnum \value{curprobpts} = 1\else s\fi}\/)}
}{\ifnum \value{totalparts} = 0
	\addtocounter{totalpoints}{\value{curprobpts}}	% Add pts to total.
	\addtocounter{pagepoints}{\value{curprobpts}}
	\else \ifnum \value{totalparts} = \value{curprobpts}
	\else \typeout{}
	\typeout{!!!!!!!   POINT ACCOUNTING ERROR   !!!!!!!!}
	\typeout{PROBLEM [\theproblemnum] WAS ALLOCATED \arabic{curprobpts} POINTS,}
	\typeout{BUT CONTAINS PARTS TOTALLING \arabic{totalparts} POINTS!}
	\typeout{}
	\fi
\fi
}
\newcommand{\newpart}[1]
{
\refstepcounter{partnum}
\hspace{0.25in}	
\ifnum #1 > 0
	\makebox[0.5in][l]{{\bf \thepartnum.} {\bf ({\it #1 pt\ifnum #1 = 1\else s\fi\/}) \,\,}}
\else
	\makebox[0.25in][l]{({\bf \thepartnum})}
\fi
\hspace{0.1in}	
\addtocounter{totalparts}{#1}
\addtocounter{pagepoints}{#1}
\addtocounter{totalpoints}{#1}
}
\newcommand{\skipproblem}[1]{\addtocounter{problemnum}{#1}}

\newcommand{\showpoints}
{
\typeout{}  
\typeout{====> A TOTAL OF \arabic{totalpoints} POINTS WERE READ.}
\typeout{}
}
%%%%%end testpoints.tex
%\input{testpoints}

\begin{document}


%%%(change to appropriate class and semester)
MATH 2222HJ Spring 2016

%%%(change to appropriate quiz type and date)
Quiz 5 \hspace{1.9in} {SOLUTION}
\vspace{2pc}

%%%(modify rules, time, points as appropriate)
Show all work clearly and in order, and circle your final answers.  

Justify your answers algebraically whenever possible. Unjustified work may not receive full credit.
\vspace{2pc}

\begin{problem}{2}
Suppose that $f(x,y,z)=3yze^{2x}$ and $x=2t$, $y=4t$, and $z=\sin(2t)$. Compute $\dfrac{\mathrm{d}f}{\mathrm{d}t}$ whenever $t=\dfrac{\pi}{2}$. \\
\textit{Solution:} By the chain rule,
$$\begin{array}{ll}
\dfrac{\mathrm{d}f}{\mathrm{d}t} &= \dfrac{\partial f}{\partial x} \dfrac{\mathrm{d}x}{\mathrm{d}t}+\dfrac{\partial f}{\partial y} \dfrac{\mathrm{d} y}{\mathrm{d}t} + \dfrac{\partial f}{\partial z} \dfrac{\mathrm{d}z}{\mathrm{d}t} \\
&= 2\left( 6yze^{2x} \right) + 4\left( 3ze^{2x} \right)+ \left( 2\cos(2t) \right) \left( 3ye^{2x} \right) \\
\end{array}$$
When $t=\dfrac{\pi}{2}$ we have $x=\pi, y=2\pi,$ and $z=0$, so 
$$\dfrac{\mathrm{d}f}{\mathrm{d}t} \Big|_{t=\frac{\pi}{2}} = 0+0+6 \cos(\pi) (2\pi) e^{2\pi}=-12 \pi e^{2\pi}.$$
\end{problem}

\begin{problem}{3}
Consider the function $f(x,y)=6x^2+4xy-3y^2$ and the point $P=(6,-1)$. Find the direction of steepest ascent at $P$ and find a vector that points in the direction of no change at $P$. \\
\textit{Solution}: First compute
$$\nabla f(x,y) = \left<12 x + 4y,4x-6y \right>.$$
A well-known theorem says that the direction of steepest ascent of $f$ at a point is in the direction of the gradient of $f$ at that point. Hence the direction of steepest ascent at $(6,-1)$ is in the direction of the vector
$$\nabla f(6,-1)= \left< 12(6)+4(-1), 4(6) - 6(-1) \right> = \left<68,30 \right>.$$
Note: you don't need to normalize this vector unless you plan to compute the ``maximum rate of change" in this direction. \\
It is also well-known that the direction of no change is in the direction orthogonal to the level curve of $f$ that touches the point in question. Recall that level curves are of the form $k=f(x,y)$ for some $k$. To find $k$, we plug in the point $(6,-1)$ into this equation to get
$$k = f(6,-1)= 6(6^2)+4(6)(-1)-3(-1)^2 = 216-24-3=189,$$
hence the point $(6,-1)$ lies on the level curve given by the equation $189=f(x,y)$, or equivalently
$$0=6x^2+4xy-3y^2-189.$$
This is a curve in the plane. We wish to find the slope of the tangent line of this curve at the point $(6,-1)$. To do this, first notice our level curve is of the form $0=F(x,y)$ where $F(x,y)=6x^2+4xy-3y^2-189$. We use the implicit differentiation formula $\dfrac{\mathrm{d}y}{\mathrm{d}x}=-\dfrac{F_x}{F_y}$ to see
$$\dfrac{\mathrm{d}y}{\mathrm{d}x} = -\dfrac{12x + 4y}{4x-6y},$$
and so the tangent at $(6,-1)$ has slope
$$\dfrac{\mathrm{d}y}{\mathrm{d}x} \Big|_{x=6,y=-1} = - \dfrac{12(6)+4(-1)}{4(6)-6(-1)} = -\dfrac{34}{15}.$$
Recall that the vector $<a,b>$ is parallel to the line with slope $\dfrac{b}{a}$, so we see from this that the vector $<-15,34>$ is parallel to the tangent line at $(6,-1)$, i.e. the vector $<-15,34>$ is in the direction of no change at $(6,-1)$. \\
----------------------------------------------------------------- \\
Note: we can check the result for the direction of no change. It means if we take the directional derivative of $f$ in the direction $<-15,34>$ at $(6,-1)$, we should get a zero result. Let 
$$\vec{u}=\dfrac{<-15,34>}{\lVert <-15,34> \rVert}=\dfrac{<-15,34>}{\sqrt{(-15)^2+34^2}}=\dfrac{<-15,34>}{\sqrt{1381}}.$$
Compute
$$\begin{array}{ll}
D_{\vec{u}} f(x,y) &\stackrel{\mathrm{def}}{=} \nabla f(x,y) \cdot \vec{u} \\
&=\left< 12x+4y, 4x-6y \right> \cdot \dfrac{<-15,34>}{\sqrt{1381}}. 
\end{array}$$
Hence
$$\begin{array}{ll}
D_{\vec{u}} f(6,-1) &=\dfrac{1}{\sqrt{1381}} \left< 68, 30 \right> \cdot \left< -15,34 \right> \\
&= \dfrac{1}{\sqrt{1381}} \left( -1020 + 1020 \right) \\
&= 0,
\end{array}$$
as was to be shown.
\end{problem}

\showpoints
\end{document}